<?php 
/**
 * 
 * @author shitou
 *
 */
class SellModel extends Model {
	
	/**
	 * 读卡
	 * @param String $vipno 会员卡号/手机号码
	 * @return array
	 */
	public function readCard($vipno){
		
		$map['vipno'] = $vipno;
		return sendRest("MMS/Custom/view",$map);
	}
	
	/**
	 * 转移购物车
	 * @param  String $vipno 会员卡号/手机号码
	 */
	public function transfer($cat){
		
		$map  = getMemberSession();
		$map['old']   = $cat['old'];
		$map['oldid'] = $cat['oldid'];
			
		setSession($cat['oldid'],$cat['old']);//重新设置session
		sendRest("OMS/Cart/transfer",$map);
	}
	
	/**
	 * 查询客户拥有的计时消费项目
	 */
	public function timeUser(){
		
		$map  = getMemberSession();
		$json = sendRest("OMS/Sell/timeUser",$map);
		
		return $json;
	}
	
	/**
	 * 查询正在进行的计时消费项目
	 */
	public function timeNowItem(){
		return sendRest("OMS/Sell/timeNowItem");
	}
	
	/**
	 * 查询所有的计时消费项目
	 */
	public function proList(){
		
		$map['typeid'] = 4;
		return sendRest("PMS/Product/proList",$map);
	}
	
}?>